# nodes/__init__.py


# nodes/__init__.py

# =========================
# 💉 Set JavaScript
# =========================

WEB_DIRECTORY = "./web/"

# Import NODE_CLASS_MAPPINGS and NODE_DISPLAY_NAME_MAPPINGS from each submodule if present
try:
    from .batchers import NODE_CLASS_MAPPINGS as BATCH_PROCESSOR_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as BATCH_PROCESSOR_NAMES
except ImportError:
    BATCH_PROCESSOR_CLASSES, BATCH_PROCESSOR_NAMES = {}, {}

try:
    from .image_analysis import NODE_CLASS_MAPPINGS as IMG_ANALYSIS_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_ANALYSIS_NAMES
except ImportError:
    IMG_ANALYSIS_CLASSES, IMG_ANALYSIS_NAMES = {}, {}

try:
    from .image_loader import NODE_CLASS_MAPPINGS as IMAGE_LOADER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMAGE_LOADER_NAMES
except ImportError:
    IMAGE_LOADER_CLASSES, IMAGE_LOADER_NAMES = {}, {}

try:
    from .image_saver import NODE_CLASS_MAPPINGS as IMG_SAVER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_SAVER_NAMES
except ImportError:
    IMG_SAVER_CLASSES, IMG_SAVER_NAMES = {}, {}

try:
    from .image_scorer import NODE_CLASS_MAPPINGS as IMG_SCORER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_SCORER_NAMES
except ImportError:
    IMG_SCORER_CLASSES, IMG_SCORER_NAMES = {}, {}

try:
    from .int_switches import NODE_CLASS_MAPPINGS as INT_SWITCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as INT_SWITCH_NAMES
except ImportError:
    INT_SWITCH_CLASSES, INT_SWITCH_NAMES = {}, {}

try:
    from .int_switches_widget import NODE_CLASS_MAPPINGS as INT_WIDGET_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as INT_WIDGET_NAMES
except ImportError:
    INT_WIDGET_CLASSES, INT_WIDGET_NAMES = {}, {}

try:
    from .random_prompt_selectors import NODE_CLASS_MAPPINGS as PROMPT_SELECTOR_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as PROMPT_SELECTOR_NAMES
except ImportError:
    PROMPT_SELECTOR_CLASSES, PROMPT_SELECTOR_NAMES = {}, {}

try:
    from .randomizers import NODE_CLASS_MAPPINGS as RANDOMIZER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as RANDOMIZER_NAMES
except ImportError:
    RANDOMIZER_CLASSES, RANDOMIZER_NAMES = {}, {}

try:
    from .text_switches import NODE_CLASS_MAPPINGS as TEXT_SWITCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TEXT_SWITCH_NAMES
except ImportError:
    TEXT_SWITCH_CLASSES, TEXT_SWITCH_NAMES = {}, {}

try:
    from .type_converter import NODE_CLASS_MAPPINGS as TYPE_CONVERTER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TYPE_CONVERTER_NAMES
except ImportError:
    TYPE_CONVERTER_CLASSES, TYPE_CONVERTER_NAMES = {}, {}

# Combine all NODE_CLASS_MAPPINGS
NODE_CLASS_MAPPINGS = {}
NODE_CLASS_MAPPINGS.update(BATCH_PROCESSOR_CLASSES)
NODE_CLASS_MAPPINGS.update(IMG_ANALYSIS_CLASSES)
NODE_CLASS_MAPPINGS.update(IMAGE_LOADER_CLASSES)
NODE_CLASS_MAPPINGS.update(IMG_SAVER_CLASSES)
NODE_CLASS_MAPPINGS.update(IMG_SCORER_CLASSES)
NODE_CLASS_MAPPINGS.update(INT_SWITCH_CLASSES)
NODE_CLASS_MAPPINGS.update(INT_WIDGET_CLASSES)
NODE_CLASS_MAPPINGS.update(PROMPT_SELECTOR_CLASSES)
NODE_CLASS_MAPPINGS.update(RANDOMIZER_CLASSES)
NODE_CLASS_MAPPINGS.update(TEXT_SWITCH_CLASSES)
NODE_CLASS_MAPPINGS.update(TYPE_CONVERTER_CLASSES)

# Combine all NODE_DISPLAY_NAME_MAPPINGS
NODE_DISPLAY_NAME_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS.update(BATCH_PROCESSOR_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_ANALYSIS_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(IMAGE_LOADER_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_SAVER_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_SCORER_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(INT_SWITCH_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(INT_WIDGET_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(PROMPT_SELECTOR_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(RANDOMIZER_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(TEXT_SWITCH_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(TYPE_CONVERTER_NAMES)

# Version info
__version__ = "1.5.0"

print(f"Endless Sea of Stars Custom Nodes v{__version__} loaded successfully!")
print("Nodes available under 'Endless 🌊✨' menu")
